package cn.hznc.controller.toolAnalyze;

import cn.hznc.controller.service.toolAnalyze.IntelligentToolChartService;
import cn.hznc.domain.entity.IntelligentToolChartEntity;
import cn.hznc.domain.entity.MachineToolDataLog;
import cn.hznc.domain.entity.MenuIdAndMenuNameEntity;
import cn.hznc.domain.request.order.QueryOrderReq;
import cn.hznc.domain.request.toolAnalyze.IntelligentToolChartReq;
import cn.hznc.domain.response.PageResult;
import cn.hznc.domain.response.ResponseBody;
import cn.hznc.vo.IntelligentToolChartVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin(origins = "*", maxAge = 3600)
@RequestMapping("/intelligentToolChart")
@Slf4j
public class IntelligentToolChartController {
    @Resource
    private IntelligentToolChartService intelligentToolChartService;

    @RequestMapping(value = "/queryIntelligentToolChartByDay", method = RequestMethod.POST)
    public ResponseBody<List<IntelligentToolChartVo>> queryIntelligentToolChartByDay(@RequestBody IntelligentToolChartReq intelligentToolChartReq) {
        return ResponseBody.success(intelligentToolChartService.queryIntelligentToolChartByDay(intelligentToolChartReq));
    }

    @RequestMapping(value = "/queryIntelligentToolChartByMonth", method = RequestMethod.POST)
    public ResponseBody<List<IntelligentToolChartVo>> queryIntelligentToolChartByMonth(@RequestBody IntelligentToolChartReq intelligentToolChartReq) {
        return ResponseBody.success(intelligentToolChartService.queryIntelligentToolChartByMonth(intelligentToolChartReq));
    }

    @RequestMapping(value = "/queryIntelligentToolRecordByMonth", method = RequestMethod.POST)
    public ResponseBody<List<Map<String,Object>>> queryIntelligentToolRecordByMonth(@RequestBody IntelligentToolChartReq intelligentToolChartReq) {
        return ResponseBody.success(intelligentToolChartService.queryIntelligentToolRecordByMonth(intelligentToolChartReq));
    }
}
